<template>
	<view class="body" :style="{background:background}">
		<block v-if="type == 0">
			<image v-if="hasImg" :src="img" class="nothing pet-center" mode="widthFix"></image>
			<div class="body-title">
				{{ title }}
			</div>
		</block>
		<block v-else>
			<image class="nothingTwo" :class="{}" :style="{width:width}" src="http://img.green-med.cn/tmp/NEXkHZLts7hVdad61a9768d9bcb6993f19c4a442228c.png" mode="widthFix"></image>
		</block>
	</view>
</template>

<script>
	export default {
		props: {
			//提示文本
			title: {
				type: String,
				default: '暂无数据'
			},
			//是否展示图片
			hasImg: {
				type: Boolean,
				default: true
			},
			type:{
				type:Number,
				default:0
			},
			//背景颜色
			background:{
				type:String,
				default:''
			},
		},
		data() {
			return {
				img: '/static/img/nothing.svg'
			};
		}
	}
</script>

<style lang="scss">
	.body{
		// position: absolute;
		width: 100%;
		height:100%;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		image {
			width:33.49vw;
			margin-bottom: 4.27vw;
		}
		div {
			text-align: center;
			color:#BBBBBB;
			font-size: 3.73vw;
			width: 29vw;
		}
		.body-title{
			width: 100%;
			color: #FFFFFF;
		}
		.nothingTwo{
			width: 100%;
			background: transparent;
		}
	}
</style>

